#pragma once
#include <exception>
#include <string>


class TException : public std::exception {
    const int code;
    std::string msg;
public:
    TException(int new_code, std::string new_msg="") : code(new_code), msg(new_msg) {
    }
    TException(std::string new_msg="") : code(0), msg(new_msg) {
    }
    const char* what() const throw() {
        return msg.c_str();
    }
    ~TException() throw() {}
};
